﻿@using X.PagedList;
@using X.PagedList.Mvc.Core;
@using X.PagedList.Mvc.Common;
@using FwProject.Restaurant.Dto
@model IPagedList<RestaurantOutputDto>
@{
    Layout = null;
    int i = 0;
    if (Model.Count > 0)
    {
        if (Model.PageNumber != 1)
        {

            i = (Model.PageNumber - 1) * Model.PageSize;
        }
    }
}

<table class="table table-bordered table-hover table-rowselected" id="t">
    <thead>
        <tr>
            <th style="text-align:center;width: 40px;">
                <div class="i-checks" id="chkDiv">
                    <label class="ibox-tools" id="latd1">
                        <input type="checkbox" id="che" value="">
                    </label>
                </div>
            </th>
            <th>序号</th>
            <th>餐厅名称</th>
            <th>司机</th>
        </tr>
    </thead>
    <tbody>
        @if (Model.Count == 0)
        {
            <tr><td colspan="8" align="center">暂无数据</td></tr>
        }
        else
        {
            foreach (var item in Model)
            {
                i++;
                <tr>
                    <td style="text-align:center">
                        <div class="i-checks" data-value="@item.Id">
                            <input type="hidden" value="@item.RestaurantName" />
                            <input type="checkbox" name="che" value="@item.Id"> <i></i>
                        </div>
                    </td>
                    <td>@i</td>
                    <td>@item.RestaurantName</td>
                    <td>@item.DriverName</td>
                </tr>
            }
        }
    </tbody>
</table>
<div class="row pagedinfo">
    <div class="col-sm-5">
        共 @Model.TotalItemCount 条， @Model.PageSize 条/页 当前第 @Model.PageNumber/@Model.PageCount 页
    </div>
    <div class="col-sm-7">
        @Html.PagedListPager(Model, page => Url.Action("SelectRestaurantData", new { id = page, keyword = Context.Request.Query["keyword"] }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions() { AllowCache = false, HttpMethod = "Get", UpdateTargetId = "data_list_2", OnSuccess = "LoadDataSuccessMessage", OnBegin = "AjaxBegin" }))
    </div>
</div>



